{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field, render_submit %}
{% include "security/_messages.html" %}
{% block title %}注册{% endblock %}

{% block content %}
<div class="form-horizontal">
  <br>
  <h3 class="text-center">注册</h3>
  <br>
  <form action="{{ url_for_security('register') }}" method="POST" name="register_user_form">
    {{ register_user_form.hidden_tag() }}
    {{ render_field_with_errors(register_user_form.name) }}
    {{ render_field_with_errors(register_user_form.email) }}
    {{ render_field_with_errors(register_user_form.password) }}
    {% if register_user_form.password_confirm %}
      {{ render_field_with_errors(register_user_form.password_confirm) }}
    {% endif %}
    {{ render_submit('注册') }}
  </form>
  <br>
  <div class="text-center">
    <a class="btn btn-default" href="/login/douban/"><i class="fa fa-weixin"></i> 豆瓣</a>
    <a class="btn btn-default" href="/login/github/"><i class="fa fa-github"></i> GitHub</a>
  </div>
  <div class="menu">
    <p class="center"><a href="{{ url_for_security('login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">已有账号登录?</a></p>
  </div>
</div>
{% endblock %}
